From 2c472bf55289ccbd7f305aa3e98d6fd70be4e3ab Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 19 Feb 2022 12:02:10 +0100
Subject: [PATCH] gdk-pixbuf-loader/Makefile.am: set GDK_PIXBUF_MODULEDIR

Set GDK_PIXBUF_MODULEDIR to gdk_pixbuf_moduledir before calling
gdk-pixbuf-query-loaders to build a correct gdk_pixbuf_cache_file and
gdk-pixbuf.loaders on 'exotic' systems

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status:
https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/668]
---
 gdk-pixbuf-loader/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdk-pixbuf-loader/Makefile.am b/gdk-pixbuf-loader/Makefile.am
index c3493736..de1f9641 100644
--- a/gdk-pixbuf-loader/Makefile.am
+++ b/gdk-pixbuf-loader/Makefile.am
@@ -49,7 +49,7 @@ rsvg_loader_LDADD = \
 EXTRA_rsvg_loader_DEPENDENCIES = libpixbufloader-svg.la gdk-pixbuf-loaders
 
 gdk-pixbuf-loaders: Makefile
-	$(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null
+	$(AM_V_GEN) ( $(GDK_PIXBUF_QUERYLOADERS) ./libpixbufloader-svg.la && GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS)) > gdk-pixbuf.loaders 2>/dev/null
 
 if CROSS_COMPILING
 RUN_QUERY_LOADER_TEST=false
@@ -68,7 +68,7 @@ endif
 install-data-hook:
 	@if $(RUN_QUERY_LOADER_TEST) ; then \
 		$(mkinstalldirs) $(DESTDIR)$(gdk_pixbuf_binarydir) ; \
-		$(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \
+		GDK_PIXBUF_MODULEDIR=$(gdk_pixbuf_moduledir) $(GDK_PIXBUF_QUERYLOADERS) > $(DESTDIR)$(gdk_pixbuf_cache_file) ; \
 	else \
 	  echo "***" ; \
 	  echo "*** Warning: loaders.cache not built" ; \
-- 
2.34.1

